﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PR_SalaryCommandDetail.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PR_SalaryCommandDetail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
  <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/DatePicker.js">
        
    </script>
<script type="text/javascript">   

          function isNumberKeyDot(event)  // ตัวเลขทศนิยม
          {
             var charCode = (event.which) ? event.which : event.keyCode
             if(charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46){
             //    alert("กรอกได้แต่ตัวเลขทศนิยมครับ!")
                 return false;
	          }
             return true;
          }
          function isNumberKey(event)  // ตัวเลขอย่างเดียว
          {
             var charCode = (event.which) ? event.which : event.keyCode
             if(charCode > 31 && (charCode < 48 || charCode > 57)){
//                 alert("กรอกได้แต่ตัวเลขครับ!")
                 return false;
	          }
             return true;
          }
           function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
          } 
            function openProjectDetails(id)
            {
                radopen("PR_SalaryDetail.aspx?id=" + id , "ProjectDtls");
                 return false;

                //maximunWindow();
            }
            function openWin()
            {
                var oWnd = radopen("DialogEmp.aspx", "RadWindow1");
            }
            function confirmFn()
            {
                if (confirm("คุณต้องการเพิ่มรายชื่อบุคลากรอัตโนมัติ ใช่ หรือ ไม่?"))
                {
                    //alert("confirm returned the following result: true");
                }
                else
                {
                    //alert("confirm returned the following result: false");
                }

            }

</script>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

       <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>
    
    
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
    <telerik:RadWindow 
        id="ProjectDtls" 
        runat="server"
        showcontentduringload="false"
        VisibleStatusbar="false"
        title="--"
        width="1100px"
        Height="600px"        
        Modal="true"
        behaviors="Close">
    </telerik:RadWindow>
</Windows>

        <Windows>
            <telerik:RadWindow 
                ID="RadWindow1"  
                DestroyOnClose = "true"               
                Modal ="true"                
                VisibleStatusbar ="false"
                runat="server">
            </telerik:RadWindow>
        </Windows>


</telerik:RadWindowManager>

    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />    
    
      <asp:panel ID="Panel6" runat="server" >
        <div class="moduleDivSlim850">
        <div class="moduleDivBottom850">
        <table align="center" width ="830px" >
        <tr>
            <td class ="tableHeader">บัญชีรายละเอียด 
                <asp:Label ID="lblCmdName" runat="server" Text="...ไม่ระบุ..." ForeColor="Blue"></asp:Label>
                &#160;&#160;&#160;&#160;&#160; แนบท้ายคำสั่งที่ 
                <asp:Label ID="lblRefNo" runat="server" Text="...ไม่ระบุ..." ForeColor="Blue"></asp:Label>
                &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ลงวันที่ 
                <asp:Label ID="lblAppDate" runat="server" Text="...ไม่ระบุ..." ForeColor="Blue"></asp:Label>
                <asp:Label ID="lblID" runat="server" Visible="False"></asp:Label>
            </td>
        </tr>
        </table>
        <table align="center" width ="830px" >
        <tr>
        <td >
        <asp:Panel ID="PanelGrid" 
            runat="server" 
            Width="820px" 
            Height="350px" ScrollBars="Auto" >
                <telerik:RadGrid ID="RadGrid2" runat="server" 
                    AllowAutomaticDeletes="True" 
                    AllowFilteringByColumn="True" 
                    AllowMultiRowEdit="True" 
                    AllowMultiRowSelection="True" AllowPaging="True" 
                    AllowSorting="True" 
                    AutoGenerateColumns="False" EnableAJAX="True" 
                    EnableAJAXLoadingTemplate="True" GridLines="None" 
                    OnItemCommand="RadGrid2_ItemCommand" Skin="Outlook" Width="800px">
                    <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                        ClientDataKeyNames="cmd_dtls_seq" 
                        CommandItemDisplay="Top" DataKeyNames="cmd_dtls_seq" 
                        InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                            CommandName="InitInsert" 
                                            Visible="<%# !RadGrid2.MasterTableView.IsItemInserted && RadGrid2.EditIndexes.Count <= 0 %>">
                                        <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                            style="border: 0px; vertical-align: middle;" /> เพิ่มรายชื่อบุคลากร</asp:LinkButton>
                                        &nbsp;&nbsp;
                                    </td>
                                    <td align="right">
                                    <asp:LinkButton ID="cmdInsertSelect" runat="server" CausesValidation="False" 
                                            CommandName="InsertSelect"                                             
                                            Visible="<%# !RadGrid2.MasterTableView.IsItemInserted && RadGrid2.EditIndexes.Count <= 0 %>">
                                        <img alt="" src="../Images/Buttons/add.gif" 
                                            style="border: 0px; vertical-align: middle;" /> เพิ่มรายชื่อบุคลากรอัตโนมัติ
                                    </asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
  
                        <ExpandCollapseColumn Visible="True">
                        </ExpandCollapseColumn>
                                      
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton"
                                EditText="คลิกเพื่อแก้ไขข้อมูล">
                                <ItemStyle Width="15px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" 
                                ConfirmDialogType="RadWindow" ConfirmText="ลบข้อมูลที่เลือก?" 
                                Text="คลิกเพื่อลบข้อมูล" UniqueName="column1">
                                <HeaderStyle HorizontalAlign="Center" Width="10px" />
                                <ItemStyle HorizontalAlign="Center" Width="10px" />
                            </telerik:GridButtonColumn>
                            
                            
                           
                            <telerik:GridBoundColumn DataField="new_pos_ref" HeaderText="เลขประจำตำแหน่ง" 
                               ShowFilterIcon="false"
                               FilterControlWidth="100%"
                               CurrentFilterFunction="Contains"
                               AutoPostBackOnFilter="true"
                                UniqueName="new_pos_ref">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            
                            
                            <telerik:GridTemplateColumn
                                        HeaderText = "ชื่อ-สกุล"
                                        DataField = "full_name"
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter="true" 
                                        CurrentFilterFunction="Contains" 
                                        ShowFilterIcon="False">
                                       <ItemTemplate>
                                             <%# Eval("full_name")%>                       
                                        </ItemTemplate>
                           <HeaderStyle HorizontalAlign="Center"/>
                            </telerik:GridTemplateColumn>
                            
                            
                            <telerik:GridBoundColumn DataField="new_pos_name" HeaderText="ตำแหน่ง" 
                               ShowFilterIcon="false"
                               FilterControlWidth="100%"
                               CurrentFilterFunction="Contains"
                               AutoPostBackOnFilter="true"
                                UniqueName="new_pos_name">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            
                            <telerik:GridBoundColumn DataField="class_name" HeaderText="ระดับ" 
                               ShowFilterIcon="false"
                               FilterControlWidth="100%"
                               CurrentFilterFunction="Contains"
                               AutoPostBackOnFilter="true"
                                UniqueName="class_name">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>       
                            
                            <telerik:GridBoundColumn DataField="new_job_site_name" HeaderText="สังกัด" 
                               ShowFilterIcon="false"
                               FilterControlWidth="100%"
                               CurrentFilterFunction="Contains"
                               AutoPostBackOnFilter="true"
                                UniqueName="new_job_site_name">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>  
                            
                            <telerik:GridBoundColumn DataField="old_salary" HeaderText="เงินเดือนก่อนปรับ" 
                               ShowFilterIcon="false"
                               FilterControlWidth="100%"
                               CurrentFilterFunction="Contains"
                               AutoPostBackOnFilter="true"
                                UniqueName="old_salary" DataFormatString="{0:#,##0.00}">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Right" />
                            </telerik:GridBoundColumn>  
                            
                            <telerik:GridBoundColumn DataField="new_salary" HeaderText="เงินเดือนหลังปรับ" 
                               ShowFilterIcon="false"
                               FilterControlWidth="100%"
                               CurrentFilterFunction="Contains"
                               AutoPostBackOnFilter="true"
                                UniqueName="new_salary" DataFormatString="{0:#,##0.00}">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Right" />
                            </telerik:GridBoundColumn>   
                            
                            
                     
                        </Columns>
                        <EditFormSettings EditFormType="WebUserControl" 
                            UserControlName="../UserControls/PR_SalaryCommandDetail.ascx">
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                        <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    </MasterTableView>
                    <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
                        EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                    </ClientSettings>
                </telerik:RadGrid>
            </asp:Panel>
                </td>
                </tr>
                </table>
                </div>
</div>

</asp:panel>
    </div>
    </form>
</body>
</html>
